<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>password</title>
</head>
<body>

<table width="100%" align="center">
<tr>
<td>
	<form:form modelAttribute="password" action="${pageContext.request.contextPath}/user/changePassword" method="post">
		<fieldset class="smallForm">
		<table width="100%" height="100%">
			<tr><td colspan="2" align="center" height="20">Zmień hasło</td></tr>
			<tr>
			<td colspan="2"><form:input type="hidden" path="username" disabled="true"/></td>
			</tr>
			<tr>
			<td>Stare hasło</td>
			<td><form:input type="password" path="oldPassword" /></td>
			</tr>
			<tr>
			<td>Nowe hasło</td>
			<td><form:input type="password" path="newPassword" /></td>
			</tr>
			<tr>
			<td>Powtórz nowe hasło</td>
			<td><form:input type="password" path="rePassword" /></td>
			</tr>
			<tr>
			<td colspan="2">
				<button type="submit" class="skip">Zmień hasło</button>
			</td>
			</tr>
		</table>
		</fieldset>
	</form:form>
</td>
</tr>
</table>
<center>
<c:if test="${param.save=='1'}"><span class="info">Dane zostały zapisane</span></c:if>
<c:if test="${param.oldPasswordFaild=='1'}"><span class="error">Błąd starego hasła</span></c:if>
<c:if test="${param.newPasswordFaild=='1'}"><span class="error">Błąd nowego hasła</span></c:if>
<c:if test="${param.error!=null}"><span class="error"><% out.print(request.getParameter("error")); %></span></c:if>
</center>
</body>
</html>
